Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0;

var _computedBehavior = _interopRequireDefault(require("./computedBehavior")), _relationsBehavior = _interopRequireDefault(require("./relationsBehavior")), _safeAreaBehavior = _interopRequireDefault(require("./safeAreaBehavior")), _safeSetDataBehavior = _interopRequireDefault(require("./safeSetDataBehavior")), _funcBehavior = _interopRequireDefault(require("./funcBehavior")), _compareVersion = _interopRequireDefault(require("./compareVersion"));

function _interopRequireDefault(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

function ownKeys(r, e) {
    var t, o = Object.keys(r);
    return Object.getOwnPropertySymbols && (t = Object.getOwnPropertySymbols(r), e && (t = t.filter(function(e) {
        return Object.getOwnPropertyDescriptor(r, e).enumerable;
    })), o.push.apply(o, t)), o;
}

function _objectSpread(r) {
    for (var e = 1; e < arguments.length; e++) {
        var t = null != arguments[e] ? arguments[e] : {};
        e % 2 ? ownKeys(t, !0).forEach(function(e) {
            _defineProperty(r, e, t[e]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : ownKeys(t).forEach(function(e) {
            Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(t, e));
        });
    }
    return r;
}

function _defineProperty(e, r, t) {
    return r in e ? Object.defineProperty(e, r, {
        value: t,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : e[r] = t, e;
}

function _toConsumableArray(e) {
    return _arrayWithoutHoles(e) || _iterableToArray(e) || _nonIterableSpread();
}

function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance");
}

function _iterableToArray(e) {
    if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e);
}

function _arrayWithoutHoles(e) {
    if (Array.isArray(e)) {
        for (var r = 0, t = new Array(e.length); r < e.length; r++) t[r] = e[r];
        return t;
    }
}

var _wx$getSystemInfoSync = wx.getSystemInfoSync(), platform = _wx$getSystemInfoSync.platform, SDKVersion = _wx$getSystemInfoSync.SDKVersion, libVersion = "2.6.6";

"devtools" === platform && (0, _compareVersion.default)(SDKVersion, libVersion) < 0 && wx && wx.showModal && wx.showModal({
    title: "提示",
    content: "当前基础库版本（".concat(SDKVersion, "）过低，无法使用 Wux Weapp 组件库，请更新基础库版本 >=").concat(libVersion, " 后重试。")
});

var baseComponent = function(e) {
    e = 0 < arguments.length && void 0 !== e ? e : {};
    return e.externalClasses = [ "wux-class", "wux-hover-class" ].concat(_toConsumableArray(e.externalClasses = e.externalClasses || [])), 
    e.behaviors = [ _relationsBehavior.default, _safeSetDataBehavior.default ].concat(_toConsumableArray(e.behaviors = e.behaviors || []), [ _computedBehavior.default ]), 
    e.useSafeArea && (e.behaviors = [].concat(_toConsumableArray(e.behaviors), [ _safeAreaBehavior.default ]), 
    delete e.useSafeArea), e.useFunc && (e.behaviors = [].concat(_toConsumableArray(e.behaviors), [ _funcBehavior.default ]), 
    delete e.useFunc), e.useField && (e.behaviors = [].concat(_toConsumableArray(e.behaviors), [ "wx://form-field" ]), 
    delete e.useField), e.useExport && (e.behaviors = [].concat(_toConsumableArray(e.behaviors), [ "wx://component-export" ]), 
    e.methods = _objectSpread({
        export: function() {
            return this;
        }
    }, e.methods), delete e.useExport), e.options = _objectSpread({
        multipleSlots: !0,
        addGlobalClass: !0
    }, e.options), Component(e);
}, _default = baseComponent;

exports.default = baseComponent;